package 蓝桥._2024.拼正方形;

import java.util.Scanner;
// 1:无需package
// 2: 类名必须Main, 不可修改

public class Main {
    public static void main(String[] args) {
        long m = 7385137888721L;
        long n = 10470245;
        long s = m * 4 + n;
        System.out.println(m);
        System.out.println("面积为：" + s);
        System.out.println("边长为：" + Math.sqrt(s));

        System.out.println("sqrt(m) = " + Math.sqrt(m));

        long m2 = m + n/4;
        System.out.println("m2: " + m2);
        System.out.println("sqrt(m2) = " + Math.sqrt(m2));
        // 边长2717561 仅用m个2x2的正方形就可拼成
        long v = (long)(m - Math.pow(2717561, 2)/4);
        System.out.println("2x2剩余："+ v);
        long n1 = (long) (Math.pow(2717562,2) - Math.pow(2717561,2));
        System.out.println("边长2717562 需要 1*1个数为："+ n1);
        System.out.println("1*1剩余："+(n-n1));

        // 边长2717563
        long n2 = (long) (2717563*4 + 4 - (m-v)*4);
        System.out.println("边长2717563 需要 1*1个数为："+ n2);
    }
}